package com.ferryc.modules.sys.entity.param;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.ferryc.commons.entity.DataEntity;
import com.ferryc.constant.ValidatorConstant;
import com.ferryc.modules.sys.entity.SysOrganization;

/**
 * 
 * 类名: SysOrganization <br/>
 * 作用： <br/>
 * 方法： <br/>
 * 创建者: Ferry C <br/>
 * 添加时间: 2017年11月16日 09:36:59 <br/>
 * 
 */
public class SysOrganizationParam extends DataEntity<SysOrganizationParam> {
	private static final long serialVersionUID = 1L;

	/**
	 * ParentId
	 */
	private String parentId;
	/**
	 * orgName
	 */
	@NotBlank(message = ValidatorConstant.ERROR_ORG_NAME)
	@Length(min = 2, max = 40, message = ValidatorConstant.ERROR_ORG_NAME)
	private String orgName;

	/**
	 * 排序
	 */
	private Long sort;
	/**
	 * 联系地址
	 */
	@Length(max = 200, message = ValidatorConstant.ERROR_ADDRESS_VERY_LONG)
	private String address;
	/**
	 * ZipCode
	 */
	private String zipCode;
	/**
	 * 负责人
	 */
	private String master;
	/**
	 * 电话
	 */
	@Pattern(regexp = "(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1}))+\\d{8})", message = ValidatorConstant.ERROR_MOBILE)
	private String phone;
	/**
	 * 传真
	 */
	private String fax;
	/**
	 * 邮箱
	 */
	@Email(message = ValidatorConstant.ERROR_EMAIL)
	private String email;

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public Long getSort() {
		return this.sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getMaster() {
		return this.master;
	}

	public void setMaster(String master) {
		this.master = master;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public SysOrganization toSysOrganization() {
		SysOrganization po = new SysOrganization();
		po.setId(this.id);
		po.setParentId(this.parentId);
		po.setOrgName(this.getOrgName());
		po.setSort(this.sort);
		po.setAddress(this.address);
		po.setZipCode(this.zipCode);
		po.setMaster(this.master);
		po.setPhone(this.phone);
		po.setFax(this.fax);
		po.setEmail(this.email);
		po.setCreateBy(this.createBy);
		po.setCreateDate(this.createDate);
		po.setUpdateBy(this.updateBy);
		po.setUpdateDate(this.updateDate);
		po.setRemarks(this.remarks);
		po.setDelFlag(this.delFlag);
		po.setLimit(this.limit);
		po.setOffset(this.offset);
		po.setLikeName(this.likeName);
		return po;
	}

}